#ifndef NETWORKCOMMUNICATOR_H
#define NETWORKCOMMUNICATOR_H
#include <QNetworkReply>
#include <QNetworkRequest>
#include <QNetworkAccessManager>
#include <QtScript/QScriptEngine>
#include "VideoInfo.h"

class NetworkCommunicator : public QNetworkAccessManager
{
    Q_OBJECT
    public:
        static NetworkCommunicator* instance();

    signals:
        void newSearchDone(QList<VideoInfo>);
        void newStreamUrlFound(QUrl);

    public slots:
        void search(QString);
        void findStreamUrl(QString);


    private slots:
        void videoSearchCompleted();
        void gotVideoInfo();

    private:
        explicit NetworkCommunicator(QObject *parent = 0);
        QScriptEngine engine;
        static NetworkCommunicator* inst;

    
};

#endif // NETWORKCOMMUNICATOR_H
